import http from '@/utils/request'

export const list = {
  getMaterials: {
    url: 'material/index',
    method: 'get'
  },
  getOrders: {
    url: 'material/order',
    method: 'get'
  },
  getDetails: {
    url: 'material/order/details',
    method: 'get'
  },
  getExpenditure: {
    url: 'material/expenditure',
    method: 'get'
  },
  getRecords: {
    url: 'material/records',
    method: 'get'
  },
  getAllExpenditure: {
    url: 'material/all-expenditure',
    method: 'get'
  }
}

export const getMaterials = params => {
  return http.request({
    ...list.getMaterials,
    params
  })
}

export const getOrders = params => {
  return http.request({
    ...list.getOrders,
    params
  })
}

export const getDetails = params => {
  return http.request({
    ...list.getDetails,
    params
  })
}

export const getExpenditure = params => {
  return http.request({
    ...list.getExpenditure,
    params
  })
}

export const getRecords = params => {
  return http.request({
    ...list.getRecords,
    params
  })
}

export const getAllExpenditure = params => {
  return http.request({
    ...list.getAllExpenditure,
    params
  })
}
